from django.conf import settings
from django.conf.urls.defaults import *
from django.contrib import admin
from legendofkrouzt.personagem.urls import urls as urlsPersonagem
from legendofkrouzt.item.urls import urls as urlsLoja
from legendofkrouzt.mensagem.urls import urls as urlsMensagem
from legendofkrouzt import settings

# Uncomment the next two lines to enable the admin:
admin.autodiscover()

urlpatterns = patterns('',
    (r'^$', 'legendofkrouzt.views.index'),
    (r'^cadastrar/$', 'legendofkrouzt.views.cadastrar'),
    (r'^admin/', include(admin.site.urls)),
    (r'^mudar_senha/$', 'django.contrib.auth.views.password_change',{'template_name':'mudar_senha.html'}, 'mudar_senha'),
    (r'^mudar_senha/concluido/$', 'django.contrib.auth.views.password_change_done',{'template_name':'mudar_senha_concluido.html'}, 'mudar_senha_concluido'),
    (r'^login/$', 'django.contrib.auth.views.login', {'template_name': 'login.html'}, 'login'),
    (r'^logout/$', 'django.contrib.auth.views.logout', {'next_page': '/'}),
    (r'^personagem/', include(urlsPersonagem())),
    (r'^loja/', include(urlsLoja())),
    (r'^mensagem/', include(urlsMensagem())),
)

if settings.DEBUG:
    urlpatterns += patterns('',
    (r'^media/(.*)$', 'django.views.static.serve', {'document_root': settings.MEDIA_ROOT}), 
                            )
    